package com.fesine.blog.repository;

import com.fesine.blog.domain.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

/**
 * @description: 用户仓库
 * @author: Fesine
 * @createTime:2017/12/14
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2017/12/14
 */
public interface UserRepository extends JpaRepository<User, Long> {

    /**
     * 根据用户名分页模糊查询用户
     * @param name
     * @param pageable
     * @return
     */
    Page<User> findByNameLike(String name, Pageable pageable);

    /**
     * 根据账号查询用户
     * @param username
     * @return
     */
    User findByUsername(String username);
}
